#查找路径下面所有源文件
aux_source_directory(. SRC_LIST)

SET(AVH_SRC ${CMAKE_CURRENT_SOURCE_DIR}/)
file(GLOB MAIN_HEADER ${AVH_SRC}/include/*.hpp)
file(GLOB MAIN_HEADER_AVHTTP ${AVH_SRC}/include/avhttp/*.hpp)
file(GLOB MAIN_HEADER_AVHTTP_DETAILL ${AVH_SRC}/include/avhttp/detail/*.hpp)
file(GLOB MAIN_HEADER_AVHTTP_IMPL ${AVH_SRC}/include/avhttp/impl/*.*)


#设置debug项目名后缀
set(CMAKE_DEBUG_POSTFIX "_gd")

#引用当前文件夹
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)

#设置预处理
add_definitions(-DXTTO_EXPORTS)

#设置静态库
add_library(NetAvHttp STATIC ${SRC_LIST})

#设置预编译
SET_TARGET_PROPERTIES(NetAvHttp PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "stdafx.h")
cotire(NetAvHttp)

#设置目录
set_target_properties(NetAvHttp PROPERTIES FOLDER "NetWork")

install(FILES ${MAIN_HEADER} DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/include/network COMPONENT headers)
install(FILES ${MAIN_HEADER_AVHTTP} DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/include/network/avhttp COMPONENT headers)
install(FILES ${MAIN_HEADER_AVHTTP_DETAILL} DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/include/network/avhttp/detail COMPONENT headers)
install(FILES ${MAIN_HEADER_AVHTTP_IMPL} DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/include/network/avhttp/impl COMPONENT headers)

install(TARGETS NetAvHttp 
        RUNTIME DESTINATION ${PROJECT_BINARY_DIR}/bin
		ARCHIVE DESTINATION ${PROJECT_SOURCE_DIR}/3rdlib/lib)


